<template>
  <div>
    <!-- <nuxt-link to="/manage/parent">管理系统</nuxt-link> -->
    <ul>
      <li v-for="(user,index) in list" :key="index">{{user.name}}</li>
    </ul>
    <!-- <nuxt-link to="/users">用户管理</nuxt-link>
    <nuxt-link to="/msbd">面试宝典</nuxt-link>
    <nuxt-link to="/msbd/classify">类别管理</nuxt-link>
    <nuxt-link to="/manage/123">test1</nuxt-link>
    <nuxt-link to="/manage/456">test2</nuxt-link>
    <nuxt-link to="/manage/cs">test3</nuxt-link> -->
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  async fetch({ store, $axios }) {
    const { data } = await $axios.get("http://localhost:3001/users/user-list");
    // store.commit('users/SET_LIST',data.data)
    // store.commit("msbd/SET_LIST",data.data)
    // store.commit("test/SET_LIST",data.data)
  },
  // async asyncData({ res, req, params, $axios, error }) {
  //   try {
  //     const { data } = await $axios.get(
  //       "http://localhost:3001/users/user-list"
  //     );
  //     return {
  //       tableData: data.data,
  //     };
  //   } catch (e) {
  //     error({message:'发生错误'})
  //   }
  // },

  computed: {
    ...mapState("test", ["list"]),
  },
};
</script>

<style scoped>
</style>